﻿using System;
using System.Globalization;
using MetroGA.Core;
using Windows.Networking.Connectivity;
using Windows.UI.Xaml;

namespace MetroGA.Win8.Lib
{
	internal class InformationProvider : IPlatformInformationProvider
	{
		#region Implementation of IPlatformInformationProvider

		public Tuple<int, int> Resolution { get { return new Tuple<int, int>((int)Window.Current.Bounds.Width, (int)Window.Current.Bounds.Height); } }
		public string Culture { get { return CultureInfo.CurrentCulture.Name.ToLower(); } }
		public string PlatformName { get { return "Windows"; } }
		public string PlatformVersion { get { return "Windows8"; } }
		public bool IsNetworkAvailable
		{
			get
			{
				var profile = NetworkInformation.GetInternetConnectionProfile();
				return profile != null
				       && profile.GetNetworkConnectivityLevel() == NetworkConnectivityLevel.InternetAccess;
			}
		}

		#endregion
	}
}